<?php include("include/lib_func.php"); ?>
<?php include("include/class_paging.php"); ?>
<?php include("include/item.php"); ?>
<?php include("include/member.php"); ?>


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>.: Clothingcorp :.</title>
<link rel="stylesheet" type="text/css" href="style_user/style.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="iecss.css" />
<![endif]-->
<script type="text/javascript" src="js/boxOver.js"></script>

</head>
<body>

<div id="main_container">

<div id="header"><span class="center_content"><span class="top_right"><span class="big_banner"><a href="index.php"><img src="images/logo.jpg" alt="" title="" border="0" /></a></span></span></span>
  <div class="top_right">
      <div class="big_banner"></div>
        
      </div>
    
  
       
<div id="main_content"> 
   
  <div id="menu_tab">
     <ul class="menu">
       <li><a href="index.php" class="nav">Home</a></li>
       <li class="divider"></li>
         <li><a href="profil.php" class="nav">Tentang Kami</a></li>
        <li class="divider"></li>
    <li><a href="cara_pembelian.php" class="nav">Cara Pembelian</a></li>
     <li class="divider"></li>
          <li>
		<?php 
		error_reporting(0);
		$file = "index.php";
					  $m = new Member();
					  $cek = $m->cek_login();
		
		
	//	$cek = cek_login();
						
		if ($cek == 1){
			echo "<a href='aksi/logout.php' class='nav'>Log Out</a>";
			}else{
				echo "<a href='sign_up.php' class='nav'>Log In</a>";
	        		}
				?>
				</li>
				<li class="divider"></li>
                <li><a href="search.php" class="nav">Pencarian</a></li>
            </ul>
		</div><!-- end of menu tab -->
            
		<div class="crumb_navigation">
			Navigation: <span class="current">Home</span>
		</div>        
    
		<div class="left_content">
			<div class="title_box">Kategori</div>
				<?php 
				$file = "index.php";
					  $it = new Item();
					  $kat = $it->ShowKategori();
					  ?><br />
				
			<div class="title_box">List Penjual</div>   
				<?php 
				$file = "index.php";
					  $it = new Item();
					  $pen = $it->ShowPenjual();
				?><br />
		 
			<div class="banner_adds">Iklan dipajang disini</div>    
		</div><!-- end of left content --> 

		
	<div class="center_content">
	   
			<div class="oferta">
				<div class="oferta_details">
					<div class="oferta_title">clothingcorp.com</div>
					<div class="oferta_text">
						<p>Selamat Datang pada website clothingcorp.com</p>
                        <p>Tekan bintang untuk mendapatkan bulan
                        </p>
                        <p>
                            Terimakasih telah berkunjung pada website Kami, dan semoga bermanfaat.
                        </p>
					</div>
				</div>
			</div>
			
   
   
			<div class="center_title_bar">Produk-Produk Kami</div>
			<?php 
				  $id = $_GET[id];
				  
				  $file = "browse_kategori.php";
				  $p = new Paging();
				  $batas  = 9;
		  		  $posisi = $p->cariPosisi($batas);
		  			  
				  $link  = koneksi_db();
				  $sql   = "select * from produk where id_kategori = '$id' limit $posisi,$batas";
				  $res   = mysql_query($sql,$link);
				  $sql2  = "select * from produk where id_kategori = '$id'";
				  $res2  = mysql_query($sql2,$link);

				  $jmlrecord = mysql_num_rows($res2);
		  		  $jmlhalaman = $p->jumlahHalaman($jmlrecord,$batas);
				  
				  while ($data = mysql_fetch_array($res)) :
				?>
					<div class="prod_box">

					<div class="center_prod_box">            
						 <div class="product_title"><a href="details.php?id=<?php echo $data['id_produk']; ?>"><?php echo $data['judul']; ?></a></div>
						 <div class="product_img"><img src="images/small_<?php echo $data['filegambar']; ?>"></div>
						 <div class="prod_price"><span class="price">Rp. <?php echo $data['harga']; ?></span></div>                        
					</div>
				   
					<div class="prod_details_tab">
					<a href="keranjang.php?id=<?php echo $data['id_produk']; ?>" class="prod_buy">Add to Cart</a>          
					<a href="details.php?id=<?php echo $data['id_produk']; ?>" class="prod_details">Details</a>            
					</div>                     
					</div>
				<?php 
				  endwhile; 
				?>
				
				<div class='page_paging'>
	      			<?php
		    			$linkHalaman = $p->navHalaman($_GET[halaman],$jmlhalaman,$id);
						echo $linkHalaman;
		  			?>
	  			</div>
    
		</div><!-- end of center content -->

	<div class="right_content">
			
			<?php
			$file = "index.php";
					  $m = new Member();
					  $hasil = $m->cek_login();
			
			//$hasil = cek_login();
			if ($hasil == 1): ?>
					<div class="shopping_cart">
						<div class="title_box">Informasi Member</div>
						
						<div class="border_box">
							Selamat datang <b>
							<?php
								$nama = get_nama();
								echo $nama;
							?></b>
						</div>
						
						<div class="cart_details">
							Ada <?php echo get_jml_item() ?> Item<br />
							<span class="border_cart"></span>
							Total Harga: Rp. <span class="price"><?php echo get_tot_bayar() ?></span>
						</div>
				
						<div class="cart_icon">
							<a href="view_keranjang.php" title=""><img src="images/shoppingcart.png" alt="" title="" width="35" height="35" border="0" /></a>
						</div>
			
					</div><br />
			<?php 
				endif
			?>
			
			<div class="title_box">Produk Terfavorit</div>  
		   	<?php 
		   		$file = "index.php";
					  $it = new Item();
					  $vie = $it->view_ten_produk();
				
		   	?>
		 
		 
		 
			<div class="banner_adds">
		 
				<a href="#">Iklan disini</a>
			</div>        
		 
		</div><!-- end of right content -->   


            
	</div><!-- end of main content -->
   
   
   
	<div class="footer">
	    <div class="left_footer">
		<p></p>
			<a>Kelompok 5 RBPL Kelas A</a>
		</div> 
        
        <div class="center_footer">
			<img src="images/logo.jpg" alt="" title="" width="198" height="42"/>
			<br />
			Copyright 2012<br />
        </div>
        
        <div class="right_footer">
			<a href="contact.php">Hubungi Kami</a>
		
        </div>   
   
	</div>                


</div>
<!-- end of main_container -->
</body>
</html>